package com.weilive.core.common;

import com.weilive.core.utils.FileMonitor;
import com.weilive.core.utils.FileMonitor.Listener;

public class SharedFileMonitor {

	// 文件重新加载间隔
	private final static long MONITOR_INTERVAL = 60 * 60 * 1000;
	private static FileMonitor monitor = new FileMonitor();
	static {
		SharedTimer.schedule(monitor, MONITOR_INTERVAL, MONITOR_INTERVAL);
	}

	public static FileMonitor shared() {
		return monitor;
	}

	public static void listen(String filePath, Listener listener) {
		monitor.listen(filePath, listener);
	}

	public static void unListen(String filePath, Listener listener) {
		monitor.unListen(filePath, listener);
	}
}
